﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="g2rcpSettings.aspx.cs" Inherits="g2rcp.G2RCPSettings" MasterPageFile="~/_admin/admin.master" %>

<%@ Register TagPrefix="wssuc" TagName="InputFormSection" Src="~/_controltemplates/InputFormSection.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormControl" Src="~/_controltemplates/InputFormControl.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="ButtonSection" Src="~/_controltemplates/ButtonSection.ascx" %>
<%@ Register TagPrefix="wssawc" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>


<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">

</asp:Content>

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <table width="100%" class="propertysheet" cellspacing="0" cellpadding="0" border="0">
        <tr>
            <td class="ms-descriptionText">
                <asp:label id="LabelMessage" runat="server" enableviewstate="False" class="ms-descriptionText" />
            </td>
        </tr>
        <tr>
            <td class="ms-error">
                <asp:label id="LabelErrorMessage" runat="server" enableviewstate="False" />
            </td>
        </tr>
        <tr>
            <td class="ms-descriptionText">
                <asp:validationsummary id="ValSummary" headertext="<%$SPHtmlEncodedResources:spadmin, ValidationSummaryHeaderText%>"
                    displaymode="BulletList" showsummary="True" runat="server"></asp:validationsummary>
            </td>
        </tr>
    </table>
    <style>
        .ms-inputformcontrols
        {
            width: 500px;
        }
    </style>

    <script type="text/javascript">
        function CheckCustomLdapRB() {
            var CbUserQuota = (document.getElementById("<%= RbUseCustomConnection.ClientID %>"));
            if (CbUserQuota != null) {
                CbUserQuota.checked = true;
            }
        }

    </script>

    <table border="0" cellspacing="0" cellpadding="0" width="100%">
        <wssuc:ButtonSection runat="server">
            <template_buttons>
			<asp:Button UseSubmitBehavior="false" runat="server" class="ms-ButtonHeightWidth" OnClick="BtnOK_Click" Text="<%$Resources:wss,multipages_okbutton_text%>" id="BtnOKTop" accesskey="<%$Resources:wss,okbutton_accesskey%>"/>
		</template_buttons>
        </wssuc:ButtonSection>
        
        <wssuc:InputFormSection runat="server" Title="Transfomrs AD Groups to Role" Description="Works with AD Only. Transforms AD Groups to Role" 
            id="IFSGeneralSettings3">
            <template_inputformcontrols>
                <asp:Checkbox Checked="true" Runat="server" Name="ChkGroupsToRoles" ID="ChkGroupsToRoles" Text="Transforms AD Groups to Role" />
				<wssawc:InputFormTextBox title="Claim Provider Type (Forms, TrustedProvider, Unknown)" class="ms-input" ID="Txtcpt" Columns="50" Runat="server" MaxLength=255 />
				<wssawc:InputFormTextBox title="Claim Provider Name" class="ms-input" ID="Txtcpn" Columns="50" Runat="server" MaxLength=255 />
			</template_inputformcontrols>
        </wssuc:InputFormSection>
        
        <wssuc:InputFormSection Title="LDAP settings" runat="server">
            <template_description>
			 <SharePoint:EncodedLiteral ID="EncodedLiteral1" runat="server" text="Specify LDAP connection" EncodeMethod='HtmlEncodeAllowSimpleTextFormatting'/>
		    </template_description>
            <template_inputformcontrols>
			<wssawc:InputFormRadioButton id="RbUseServerDomain"
				LabelText="Connect to SharePoint domain"
				Checked="true"
				GroupName="RbLDAPConnection"
				CausesValidation="false"
				runat="server" >
				<SharePoint:EncodedLiteral ID="EncodedLiteral2" runat="server" text="Connect to same AD as SharePoint servers, with application pool credentials." EncodeMethod='HtmlEncode'/>
			</wssawc:InputFormRadioButton>
			<wssawc:InputFormRadioButton id="RbUseCustomConnection"
				LabelText="Manually specify LDAP connection"
				GroupName="RbLDAPConnection"
				CausesValidation="false"
				runat="server" >
				<table border="0" width="100%" cellspacing="0" cellpadding="0" class="authoringcontrols">
					<wssuc:InputFormControl ID="InputFormControl1" LabelText="InputFormControlLabelText">
						<Template_control>
							<SharePoint:EncodedLiteral ID="EncodedLiteral3" runat="server" text="LDAP connection string (for example LDAP://10.0.0.1/DC=domain,DC=com):" EncodeMethod='HtmlEncode'/>
							<br/>
							<wssawc:InputFormTextBox onclick="CheckCustomLdapRB()" title="LDAP connection string" class="ms-input" ID="TxtLdapConnectionString" Columns="50" Runat="server" MaxLength=255 Text="LDAP://" />
							<br/>
						</Template_control>
					</wssuc:InputFormControl>
					<wssuc:InputFormControl ID="InputFormControl2" LabelText="InputFormControlLabelText">
						<Template_control>
							<br/>
							<SharePoint:EncodedLiteral ID="EncodedLiteral4" runat="server" text="Username (domain\username):" EncodeMethod='HtmlEncode'/>
							<br/>
							<wssawc:InputFormTextBox onclick="CheckCustomLdapRB()" title="Username" class="ms-input" ID="TxtLdapUsername" Columns="50" Runat="server" MaxLength=255 />
							<br/>
						</Template_control>
					</wssuc:InputFormControl>
					<wssuc:InputFormControl ID="InputFormControl3" LabelText="InputFormControlLabelText">
						<Template_control>
							<br/>
							<SharePoint:EncodedLiteral ID="EncodedLiteral5" runat="server" text="Password:" EncodeMethod='HtmlEncode'/>
							<br/>
							<wssawc:InputFormTextBox onclick="CheckCustomLdapRB()" title="Password" class="ms-input" ID="TxtLdapPassword" Columns="50" Runat="server" MaxLength=255 TextMode="Password" />
							<br/>
						</Template_control>
					</wssuc:InputFormControl>
					<br/>
					<asp:Button runat="server" ID="BtnTestLdapConnection" Text="Test LDAP Connection" onclick="BtnTestLdapConnection_Click" class="ms-ButtonHeightWidth" />
					<p>
					<asp:Label ID="LabelErrorTestLdapConnection" Runat="server" EnableViewState="False" class="ms-error" />
					<asp:Label ID="LabelTestLdapConnectionOK" Runat="server" EnableViewState="False" />
					</p>
				</table>
			</wssawc:InputFormRadioButton>
		    <wssawc:InputFormTextBox title="LDAP Filter" ID="TxtLdapFilter" Columns="50" Runat="server" MaxLength=255 />
			</template_inputformcontrols>
        </wssuc:InputFormSection>

        <wssuc:ButtonSection runat="server">
            <template_buttons>
			<asp:Button UseSubmitBehavior="false" runat="server" class="ms-ButtonHeightWidth" OnClick="BtnOK_Click" Text="<%$Resources:wss,multipages_okbutton_text%>" id="BtnOK" accesskey="<%$Resources:wss,okbutton_accesskey%>"/>
		</template_buttons>
        </wssuc:ButtonSection>
    
    </table>
</asp:Content>
<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
    G2RCP Configuration
</asp:Content>
<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea"
    runat="server">
    G2RCP Configuration - <a href="http://G2RCP.codeplex.com" target="_blank">G2RCP.codeplex.com</a>
</asp:Content>
